<template>
	<view class="page-box">
		<view class="form-item-box">
			<text>持卡人</text>
			<input placeholder="请输入持卡人" v-model="formData.real_name" />
		</view>
		<view class="form-item-box">
			<text>开户行</text>
			<input placeholder="请输入开户行" v-model="formData.bank_name" />
		</view>
		<view class="form-item-box">
			<text>银行卡号</text>
			<input placeholder="请输入卡号" v-model="formData.card_no" />
		</view>
		<view class="step-btn-box" @click="stepClick">
			确定
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				formData: {
					real_name: '',
					card_no: '',
					bank_name: ''
				}
			}
		},
		methods: {
			stepClick() {
				this.$http.post('addons/shopro/user_bank/edit', Object.assign({}, this.formData)).then((res) => {
					console.log(res)
					let pages = getCurrentPages()
					let prevPage = pages[pages.length - 2]
					prevPage.bankCardInfo.bankName = res.data.bank_name
					prevPage.bankCardInfo.cardNumber = res.data.card_no
					uni.navigateBack({
						delta:1
					})
				}).catch((err) => {

				})
	
			}
		}
	}
</script>

<style>
	.page-box {
		width: 100%;
		height: 100%;
		padding: 16px 16px 24px 16px;
	}

	.form-item-box {
		width: 100%;
		height: 50px;
		display: flex;
		align-items: center;
		border-bottom: 1px solid #E5E5E5;
	}

	.form-item-box>text {
		width: 70px;
		text-align: right;
		font-size: 16px;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #010101;
	}

	.form-item-box>input {
		margin-left: 16px;
		width: calc(100% - 80px);
		height: 100%;
	}

	.step-btn-box {
		position: absolute;
		left: 16px;
		bottom: 24px;
		height: 46px;
		width: calc(100% - 32px);
		line-height: 46px;
		text-align: center;
		background: #010101;
		border-radius: 23px;
		font-size: 18px;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #FFFFFF;
	}
</style>
